<template>
  <div class="operation_continer">
    <div v-hasPermi="['inventory_left_lookprice']">
      <span class="operation_continer_title">操作栏</span>
      <!-- 根据需要 添加操作按钮 --------------------------------------------------------------------->
      <el-button v-if="priceFlag" type="success" plain icon="el-icon-search" @click="handleLookPrice(0)">查看价格
      </el-button>
      <el-button v-else type="warning" plain icon="el-icon-search" @click="handleLookPrice(1)">隐藏价格
      </el-button>
    </div>
    <!-- ----------------------------------------------------------------------------------------->
  </div>
</template>

<script>
export default {
  name: 'OperationBar',
  data () {
    return {
      priceFlag: true
    }
  },
  methods: {
    // 查看价格按钮------------------------------
    handleLookPrice (val) {
      this.priceFlag = !this.priceFlag
      this.$emit('price_click', val)
    }
  }
}
</script>
<style lang="scss" scoped>
.operation_continer {
  padding: 10px;
  margin-bottom: 20px;
  display: flex;
  background-color: white;
  border-radius: 5px;

  &_title {
    line-height: 36px;
    padding: 0 20px 0 0;
    font-weight: bold;
  }
}
</style>
